package com.maila.xiaoaoschool.fragment;


import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.maila.xiaoaoschool.R;
import com.maila.xiaoaoschool.activity.CollectionActivity;
import com.maila.xiaoaoschool.activity.ContactActivity;
import com.maila.xiaoaoschool.activity.DiscountActivity;
import com.maila.xiaoaoschool.activity.FeedbackActivity;
import com.maila.xiaoaoschool.activity.LoginActivity;
import com.maila.xiaoaoschool.activity.MessageActivity;
import com.maila.xiaoaoschool.activity.MyAddressActivity;
import com.maila.xiaoaoschool.activity.MyWalletActivity;
import com.maila.xiaoaoschool.activity.OrderActivity;
import com.maila.xiaoaoschool.activity.QuestionActivity;
import com.maila.xiaoaoschool.activity.RecommendActivity;
import com.maila.xiaoaoschool.activity.SettingActivity;
import com.maila.xiaoaoschool.util.StartActivityUtils;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;
import com.zhy.autolayout.utils.AutoUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/9/23.
 */

public class PersonFragment extends Fragment {
    @BindView(R.id.ll_my_wallet)
    AutoLinearLayout llMyWallet;
    @BindView(R.id.imageView5)
    ImageView imageView5;
    @BindView(R.id.textView)
    TextView textView;
    @BindView(R.id.ll_vip)
    AutoLinearLayout llVip;
    @BindView(R.id.imageView2)
    ImageView imageView2;
    @BindView(R.id.ll_quan)
    AutoLinearLayout llQuan;
    @BindView(R.id.ll_my_order)
    AutoLinearLayout llMyOrder;
    @BindView(R.id.all_address)
    AutoLinearLayout llAddress;
    @BindView(R.id.ll_collection)
    AutoLinearLayout llCollection;
    @BindView(R.id.ll_recommend)
    AutoLinearLayout llRecommend;
    @BindView(R.id.ll_kefu)
    AutoLinearLayout llKefu;
    @BindView(R.id.ll_feedback)
    AutoLinearLayout llFeedback;
    @BindView(R.id.ll_question)
    AutoLinearLayout llQuestion;
    @BindView(R.id.user_operation)
    AutoLinearLayout userOperation;
    @BindView(R.id.btn_shezhi)
    ImageView btnShezhi;
    @BindView(R.id.payment_iv)
    ImageView paymentIv;
    @BindView(R.id.order_count1)
    TextView orderCount1;
    @BindView(R.id.payment_rll)
    AutoRelativeLayout paymentRll;
    @BindView(R.id.user_icon)
    ImageView userIcon;
    @BindView(R.id.user_name)
    TextView userName;
    @BindView(R.id.agent_level_ll)
    AutoLinearLayout agentLevelLl;
    @BindView(R.id.user_background)
    AutoRelativeLayout userBackground;
    Unbinder unbinder;

    public static PersonFragment newInstance(String param1) {
        PersonFragment fragment = new PersonFragment();
        Bundle args = new Bundle();
        args.putString("agrs1", param1);
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_presonal, container, false);
        AutoUtils.autoSize(view);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.ll_my_wallet, R.id.ll_vip, R.id.ll_quan, R.id.ll_my_order, R.id.all_address, R.id.ll_collection, R.id.ll_recommend, R.id.ll_kefu, R.id.ll_feedback, R.id.ll_question, R.id.btn_shezhi, R.id.payment_iv, R.id.agent_level_ll})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_my_wallet:
                StartActivityUtils.start(getActivity(), MyWalletActivity.class);
                break;
            case R.id.ll_vip:
                break;
            case R.id.ll_quan:
                StartActivityUtils.start(getActivity(),DiscountActivity.class);
                break;
            case R.id.ll_my_order:
                StartActivityUtils.start(getActivity(),OrderActivity.class);
                break;
            case R.id.all_address:
                StartActivityUtils.start(getActivity(), MyAddressActivity.class);
                break;
            case R.id.ll_collection:
                StartActivityUtils.start(getActivity(),CollectionActivity.class);
                break;
            case R.id.ll_recommend:
                StartActivityUtils.start(getActivity(),RecommendActivity.class);
                break;
            case R.id.ll_kefu:
                StartActivityUtils.start(getActivity(), ContactActivity.class);
                break;
            case R.id.ll_feedback:
                StartActivityUtils.start(getActivity(), FeedbackActivity.class);
                break;
            case R.id.ll_question:
                StartActivityUtils.start(getActivity(), QuestionActivity.class);
                break;
            case R.id.btn_shezhi:
                StartActivityUtils.start(getActivity(), SettingActivity.class);
                break;
            case R.id.payment_iv:
                StartActivityUtils.start(getActivity(), MessageActivity.class);
                break;
            case R.id.agent_level_ll:
                StartActivityUtils.start(getActivity(), LoginActivity.class);
                break;
        }
    }
}
